<html>
<head>
    <meta charset="utf-8">
    <title>设置我的资料</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    {{template "header"}}

</head>
<body layadmin-themealias="green-header">

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">设置我的资料</div>
                <div class="layui-card-body" pad15="">

                    <form class="layui-form layui-form-pane" enctype="multipart/form-data">
                        <div class="layui-form-item layui-hide">
                            <label class="layui-form-label">我的角色</label>
                            <div class="layui-input-inline">
                                <select name="role" lay-verify="">
                                    <option value="1" selected="">超级管理员</option>
                                    <option value="2">普通管理员</option>
                                    <option value="3">审核员</option>
                                    <option value="4">编辑人员</option>
                                </select>
                                <div class="layui-unselect layui-form-select layui-form-selected">
                                    <div class="layui-select-title"><input type="text" placeholder="请选择" value="超级管理员"
                                                                           readonly=""
                                                                           class="layui-input layui-unselect"><i
                                                class="layui-edge"></i></div>
                                    <dl class="layui-anim layui-anim-upbit" style="">
                                        <dd lay-value="1" class="layui-this">超级管理员</dd>
                                        <dd lay-value="2">普通管理员</dd>
                                        <dd lay-value="3">审核员</dd>
                                        <dd lay-value="4">编辑人员</dd>
                                    </dl>
                                </div>
                            </div>
                            <div class="layui-form-mid layui-word-aux">普通用户每天最大添加3个任务</div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">账号类型</label>
                            <div class="layui-input-inline">
                                <input type="text" name="type" value="普通会员" readonly="" class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux">更快更多短信,加微信升级账号:koling0079</div>
                            <img src="/resource/image/wechat.jpg" style="position: absolute;
    width: 157px;
    margin-left: 100px;" alt="扫描添加微信">
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">我的账号</label>
                            <div class="layui-input-inline">
                                <input type="text" name="phone" value="{{.Phone}}" readonly="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">登陆密码</label>
                            <div class="layui-input-inline">
                                <input type="password" name="password" value="{{.Password}}" class="layui-input">

                            </div>
                            <div class="layui-form-mid layui-word-aux">默认登陆密码是手机号</div>

                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">登陆时间</label>
                            <div class="layui-input-inline">
                                <input type="text" name="lastuseTime" readonly="readonly" value="{{.LastuseTime}}"
                                       readonly="" class="layui-input">

                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="savebt">确认修改</button>
                            </div>
                        </div>
                    </form>

                </div>
            </div>
        </div>
    </div>
</div>


</body>
{{template "footer"}}

<script>
    layui.use('form', function () {
        var form = layui.form;
        form.on('submit(savebt)', function (data) {
            console.log($(data.form).serialize()) //当前容器的全部表单字段，名值对形式：{name: value}
            ajaxPostNoAsync("/User", $(data.form).serialize(), function (datastr) {
                var dataInner = eval('(' + datastr + ')');
                console.log("返回内容", dataInner, typeof (dataInner), "dataInner.code=", dataInner.code, dataInner.message)
                if (dataInner.code == "success") {
                    successMsg('操作成功!')
                    return true;

                } else {
                    console.log("1")
                    failMsg('操作失败!' + dataInner.message)
                    return false;

                }
            })
        })
    })

</script>
</html>